package com.adcc.ags.msgStore.entity.mq;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Strings;

/**
 * MQ信息
 */
public class MQInfo {

    public static MQInfo instance;

    private MQInfo(){}
    /**
     * 单例模式
     * */
    public synchronized static MQInfo getInstance() {
        if (instance == null) {
            instance = new MQInfo();
        }
        return instance;
    }

    // 主机名
    private String host = Strings.nullToEmpty("");

    // 端口
    private int port = 0;

    // 通道
    private String channel = Strings.nullToEmpty("");

    // 队列管理器
    private String qm = Strings.nullToEmpty("");

    // 状态
    private MQState state = MQState.DISCONNECTED;

    public String getHost(){
        return host;
    }

    public void setHost(String host){
        this.host = host;
    }

    public int getPort(){
        return port;
    }

    public void setPort(int port){
        this.port = port;
    }

    public String getChannel(){
        return channel;
    }

    public void setChannel(String channel){
        this.channel = channel;
    }

    @JsonIgnore
    public String getQm(){
        return qm;
    }

    @JsonIgnore
    public void setQm(String qm){
        this.qm = qm;
    }

    public MQState getState(){
        return state;
    }

    public void setState(MQState state){
        this.state = state;
    }
}
